#pragma once
#include "..\Common\Global.h"

template <typename I,typename O>
class Combinator_Opt : public Combinator<I,O>
{
public:
	Combinator_Opt(Combinator_Node<I,O>& _left,Combinator_MemoryManager<I,O>* _MM) : left(_left),Combinator<I,O>(_MM){}

	virtual O Parser(I& input)
	{
		O Result(GetMM());
		Result.SetResult(TRUE);
		if(O Result1 = left.Parser(input)) Result = Result + Result1;
		return Result;
	}
protected:
	Combinator_Node<I,O>& left;
};
